{block name=table-studentclass}
<table class="table table-striped">
	<thead>
		<th>课程名称</th>
		<th>学期</th>
		<th>年龄段</th>
		<th>类型</th>
		<th>状态</th>
		<th>操作</th>
	</thead>
	<tbody>
		{foreach $student.enrolments.classterms as $ct}
			{if $ct.term_name && $ct.class_name}
				<tr id="s{$student.student_id}-t{$ct.term_object_id}-c{$ct.class_object_id}-{$ct.enrolment_type}-{$ct.enrolment_week}" {if $ct.enrolment_published neq 1 || $smarty.now|date_format:"%Y-%m-%d" gt $ct.term_end_date} class="text-deleted"{else}{assign var="isActive" value=1}{/if}>
					<td>{$ct.class_name}</td>
					<td>{$ct.term_name}</td>
					<td>{$ct.agegroup_name}</td>
					<td>{$ct.enrolment_type_name_date}</td>
					<td>{if $ct.enrolment_published eq 1}可用{else}已删除{/if}</td>
					<td class="enrolment-options">
						{assign var='hasOpt' value=0}
						{if $ct.enrolment_published eq 1 && $smarty.now|date_format:"%Y-%m-%d" lte $ct.term_end_date}
							{if $ct.enrolment_type eq 'S' || $ct.enrolment_type eq 'MV' }
								<a href="javascript:void(0)" onclick="MoveEnrolmentForm({$student.student_id},{$ct.term_object_id},{$ct.class_object_id}, '{$student.student_name|replace:"'":"\'"|escape:'html'} {$student.student_surname|replace:"'":"\'"|escape:'html'} : {$ct.class_name|escape:'html'} - {$ct.term_name|escape:'html'}', '{$student.student_dob|date_format:"%d"}', '{$student.student_dob|date_format:"%m"}', '{$student.student_dob|date_format:"%Y"}')"> 变更 </a> |
								<a href="javascript:void(0)" onclick="MakeUpClassForm({$student.student_id},{$ct.term_object_id},{$ct.class_object_id}, '{$student.student_name|replace:"'":"\'"|escape:'html'} {$student.student_surname|replace:"'":"\'"|escape:'html'} : {$ct.class_name|escape:'html'} - {$ct.term_name|escape:'html'}', '{$student.student_dob|date_format:"%d"}', '{$student.student_dob|date_format:"%m"}', '{$student.student_dob|date_format:"%Y"}')"> 补课 </a>
								{assign var='hasOpt' value=1} 
							{elseif $ct.enrolment_type eq 'T'}
								<a href="/admin/members/convert/{$user.user_id}?std={$student.student_id}&class={$ct.class_object_id}&term={$ct.term_object_id}">更换</a> |
								<a href="javascript:void(0)" data-value="s{$student.student_id}-t{$ct.term_object_id}-c{$ct.class_object_id}-{$ct.enrolment_type}-{$ct.enrolment_week}"  onclick="MoveTrialClassForm({$student.student_id},{$ct.term_object_id},{$ct.class_object_id}, '{$student.student_name|replace:"'":"\'"|escape:'html'} {$student.student_surname|replace:"'":"\'"|escape:'html'} : {$ct.class_name|escape:'html'} - {$ct.term_name|escape:'html'}', '{$student.student_dob|date_format:"%d"}', '{$student.student_dob|date_format:"%m"}', '{$student.student_dob|date_format:"%Y"}')"> 变更 </a>
								{assign var='hasOpt' value=1}  
							{/if}
							{if $isActive eq 1 && $admin.level eq 1}  
									{if $hasOpt eq 1}|{/if}
									<a href="javascript:void(0)" onclick="{if $ct.enrolment_type eq 'W'}if(ConfirmDelete())RemoveWaitList('#s{$student.student_id}-t{$ct.term_object_id}-c{$ct.class_object_id}-{$ct.enrolment_type}-{$ct.enrolment_week}', {$ct.waitlist_id}){else}CancelEnrolment({$student.student_id},{$ct.term_object_id},{$ct.class_object_id}, '{$ct.enrolment_type}', '{$ct.enrolment_week}'){/if}"> 取消</a>
							{/if} 
						{/if}
            {if $ct.reenrol && $smarty.now|date_format:"%Y-%m-%d" lte $ct.reenrol.term_end_date}
            	{if $hasOpt eq 1}|{/if}
            	<a href="/admin/members/re-enrol/{$user.user_id}?std={$student.student_id}&class={$ct.class_object_id}"> 重新报名</a>
            {/if}
					</td>
				</tr>
			{/if}
		{/foreach}
	</tbody>
</table>
{/block} 


